Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions for Getting and Playing Movies / Creating Tracks and Media Structures


NewMovieTrack

You can create movie tracks by calling the NewMovieTrack function. Immediately after creating a new track, you should call the NewTrackMedia function to create a media for the track--a track without a media is of no use.

Note that when you add a track to a movie, the Movie Toolbox automatically adjusts the display rectangle of the movie. You may want to detect these changes by calling the GetMovieBox function (described on page 2-147) so that you can adjust the size of the movie's display window.

pascal Track NewMovieTrack (Movie theMovie, Fixed width, 
                              Fixed height, short trackVolume);
theMovie
Specifies the movie for this operation. Your application obtains this movie identifier from such functions as NewMovie, NewMovieFromFile, and NewMovieFromHandle (described on page 2-80, page 2-76, and page 2-78, respectively).
width
Specifies a fixed number denoting the display width of the track, in pixels. Along with the height parameter, this parameter defines the track's display rectangle.
height
Specifies a fixed number denoting the display height of the track, in pixels.
Together, the height and width parameters define the track's display rectangle. The upper-left corner of this rectangle lies at (0,0) in the movie's rectangle. The height and width parameters therefore establish the lower-right corner of the track's display rectangle. If you are creating a track that is not displayed, such as a sound track, set the height and width parameters to 0.
trackVolume
Specifies the volume setting of the track as a 16-bit, fixed-point number. The high-order 8 bits specify the integer portion; the low-order 8 bits specify the fractional part. Volume values range from -1.0 to 1.0. Negative values play no sound but preserve the absolute value of the volume setting. Set this parameter to kFullVolume to play the track at its full, natural volume. Set this parameter to kNoVolume to set the volume to 0.
kFullVolume
Sets the track to full volume (constant value is 1.0).
kNoVolume
Sets the track to no volume (constant value is 0.0).
DESCRIPTION
The NewMovieTrack function returns a track identifier. If the function cannot create the track, it sets the returned identifier to nil.

ERROR CODES
invalidMovie-2010This movie is corrupted or invalid
Memory Manager errors


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996